<template>
	<om-page>
		<view class="tui-center">
			<view v-for="item in locations" :key="item.name">
				<view>{{item.name}}({{item.address}})</view>
			</view>
			<button @click="chooseLocation">选择位置</button>
		</view>
		
	</om-page>
</template>

<script>
	export default {
		data() {
			return {
				locations:[]
			}
		},
		methods: {
			chooseLocation(e){
				let _that = this
				uni.chooseLocation({
					success(res) {
						_that.locations.push({
							name:res.name,
							address:res.address,
							latitude:res.latitude,
							longitude:res.longitude
						})
					}
				})
			}
		}
	}
</script>

<style>

</style>
